%from utils import allcate,articlesByCreateDate,artilceByComments,alltags
%max=30;min=2
<ul>
	<li>
		<h2>公告</h2>
		<ul>
			<li>博客开通了，欢迎大家光临！多提意见。邮箱:linychuo(at)gmail.com</li>
		</ul>
	</li>
	<li>
		<h2>类别</h2>
		<ul>
			%for t in allcate():
			<li><a href="/viewcategory/{{t.id}}">{{t.cate_name}} ({{t.art_cnt}})</a></li>
			%end
		</ul>
	</li>
	<li>
		<h2>归档</h2>
		<ul>
			%date = articlesByCreateDate()
			%for t in date:
			<li><a href="/viewdate/{{t}}">{{t}} ({{date[t]}})</a></li>
			%end
		</ul>
	</li>
	<li>
		<h2>标签</h2>
		<ul class="tags"><li>
			%tags = alltags()
			%for tag in tags:
				%if tags[tag] > max:
					%classname = "ultra-popular"
				%elif tags[tag] <= max and tags[tag] > max/2:
					%classname = "very-popular"
				%elif tags[tag] <= max/2 and tags[tag] > max/3:
					%classname = "popular"
				%elif tags[tag] <= max/3 and tags[tag] > max/5:
					%classname = "somewhat-popular"
				%elif tags[tag] <= max/5 and tags[tag] > min:
					%classname = "not-very-popular"
				%else:
					%classname = "not-popular"
				%end
				<a href="/tag/{{tag}}" title="{{tags[tag]}}篇文章" class="{{classname}}">{{tag}}</a>
			%end
		</li></ul>
	</li>
</ul>